package com.syswin.lhztest.model;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.validation.constraints.Email;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;

/**
 * @author:lhz
 * @date:2018/12/4 21:17
 */
@Data
@Component
@ConfigurationProperties(prefix = "user")
//@EnableConfigurationProperties(User.class)
public class User {

	@NotNull(message="名字不能为空")
	private String namet;

	@Max(value=120,message="年龄最大不能查过120")
	private int age;

	@Email(message="邮箱格式错误")
	private String mail;
}
